<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form method="post">
{% csrf_token %}
    {{ student_data }}
    <p>名字<input type="text" value="{{ student_data.name }}"  name="name"></p>
        <p>性别<input type="text" value="{{ student_data.gender }}" name="gender"> </p>

        <p>成绩<input type="text" value="{{ student_data.score }}" name="score"></p>
    <select name="school">
        {% for foo in school_data %}
            {% if  foo.id == student_data.school.id %}
                <option value="{{ foo.id }}" selected>{{ foo.name }}</option>
            {% else %}
                <option value="{{ foo.id }}" selected>{{ foo.name }}</option>

            {% endif %}

        {% endfor %}

    </select>
    <input type="submit" value="提交">
</form>
</body>
</html>